Grimoire - Jupyter Replacement
What is Grimiore?

If you read my website for some strange reason, you will find that I have a habit of taking notes in Jupyter. I dislike doing this for a number of reasons, but the foremost have to do with security and file size. Over the years I eventually gave in for shear convenience sake, but it has been my intention for a while to create my own version of Jupyter, complete with features I like, and code I am more willing to trust.

Grimoire is exactly that. It is a simpler version of Jupyter written in Python as a Flask server. I have gripes with Flask, and with Python too, but I wanted to complete this project in one night. I had been intending to complete it for about 5 years, and I knew if I put it off any further it would never get done.

Grimoire also has a few features I always wished Jupyter would have, they are simple but versatile.

  • HTML first instead of Markdown blocks
  • Cool wizard fonts.
  • Collapsable blocks (apparently Jupyter has this)
  • Direct export to my website's format.
  • Export to a generic JSON format, that is easily parsed by anyone.
  • Better screen width scaling, mobile support.
  • Support for entire BASH scripts
  • Blocks which write entire files to disk every time they are run.

These last two are the most important. They change the program from being a strange Python IDE into something more general. Anything I do on the command line I can show here. I am not stuck using a specific programming language or tool. They also facilitate working on more complicated projects, as I can more easily work with larger files and blocks of code.

Grimoire does not contain a spell checker, this is because I am a perfect wizard who has never once failed to properly cast a spell.

Some C++ Program
main_cool_file.cpp
1
2
3
4
5
6
7
#include <stdio.h>

int main() {
	for (int i =0; i < 10; i++) {
    	printf("Hello world!\r\n");
    }
}
Clarity

To be clear, when I write that block in the editor, it saves the contents to file. Essentially giving me a tiny little text editor in my text editor. So I can now write and compile code in the program I use to format notes for my website. For me, this saves countless steps.

Compile Said Program
1
2
g++ -O3 ./main_cool_file.cpp
./a.out
Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world!
See?

I have struggled for a while now to find a good medium for sharing and explaining technical content this way. My current system is an awful amalgamation of making notes in Jupyter, turning those notes into a proper program, turning that program into a series of code snippets, putting those code snippets into an HTML document.

This is tiresome.

The idea here is I can explain each segment of the program in its own file cell, compile and run sections of it, and leave the file cells collapsed (instead of my previous tabbing system). This streamlines the entire process for me. Taking notes, working on the theoretical part of a project, and explaining the project for my spellbook can now all be done here. Isn't that cool?

What's that? You don't care? You never saw how I was writing articles anyway, and frankly you don't think the text editor I use is really your business?

I suppose that's reasonable...